import json
import re

s = b'{"referer":"http%3A%2F%2F47.107.116.139%2Fphpwind%2Findex.php%3Fm%3Du%26c%3Dlogin%26a%3Dwelcome%26_statu%3DM0FQUXdya0x6cjc3TzFvSWVVRUpidiUyQkZwSENuJTJCRkEzb1RSNEFyM0FpdkNuRzlmJTJGekVJeFclMkZYTUI0R1V2YWEwfGh0dHA6Ly80Ny4xMDcuMTE2LjEzOS9waHB3aW5kL3w","refresh":false,"state":"success","data":"","html":"","message":[""],"__error":""}'
decode_s = s.decode()
print(decode_s)
print("----------")

# data = decode_s.strip()
# 不仅仅是单纯的去掉decode_s的单引号，还解析了这个JSON字符串，识别其中的键值对、对象结构、数据类型等，并在Python中创建一个相应的字典对象（格式转化）。
# 因此json.loads()与strip()的功能不同
data = json.loads(decode_s)
print(data["referer"])
print("----------")
# statu = data["referer"].split("_statu%3D")[1]
statu = re.findall("_statu%3D(.*)", data["referer"])[0]
print(statu)

print("----------")
ss = b'{"referer":"http%3A%2F%2F47.107.116.139%2Fphpwind%2Fread.php%3Ftid%3D81802%26fid%3D2","refresh":true,"state":"success","data":"","html":"","message":["\\u64cd\\u4f5c\\u6210\\u529f"],"__error":""}'
decode_ss = ss.decode()
print(decode_ss)
print("----------")
data_ss=json.loads(decode_ss)
print(data_ss["referer"])
print("----------")
tid=re.findall("tid%3D(.*)%26fid%3D2",data_ss["referer"])[0]
print(tid)

print("----------")
c=b'{"tags":[{"id":2,"name":"\xe6\x98\x9f\xe6\xa0\x87\xe7\xbb\x84","count":0},{"id":100,"name":"???","count":0},{"id":101,"name":"zhaohaohao","count":0},{"id":102,"name":"zhao45540","count":0},{"id":103,"name":"zhaoayua\xe5\xa5\xbdb","count":0},{"id":104,"name":"zhao1712758180940","count":0},{"id":106,"name":"zhaoWOHCHD","count":0},{"id":109,"name":"zhaoHAOWCB","count":0},{"id":110,"name":"zhaoCDHWSU","count":0},{"id":121,"name":"zhaohaohao1712761802163","count":0},{"id":125,"name":"zhaoDAADBU","count":0},{"id":127,"name":"zhaoOHUCAD","count":0},{"id":129,"name":"zhaoBBUUOD","count":0},{"id":157,"name":"\xe5\xb9\xbf\xe4\xb8\x9c","count":0},{"id":158,"name":"1723469063441","count":0},{"id":159,"name":"1723469418650","count":0},{"id":160,"name":"1723469526502","count":0},{"id":161,"name":"1723469583402","count":0},{"id":162,"name":"1723469865547","count":0},{"id":163,"name":"1723470186937","count":0},{"id":164,"name":"1723470287493","count":0},{"id":165,"name":"1723470390709","count":0},{"id":166,"name":"1723471473347","count":0},{"id":167,"name":"1723471509638","count":0},{"id":168,"name":"1723471541249","count":0},{"id":182,"name":"1726123211122","count":0},{"id":183,"name":"1726123894417","count":0},{"id":184,"name":"1726123960813","count":0},{"id":185,"name":"1726123981440","count":0},{"id":186,"name":"1726123987220","count":0},{"id":187,"name":"1726123990269","count":0},{"id":188,"name":"1726124021813","count":0},{"id":189,"name":"1726124063630","count":0},{"id":206,"name":"57088653494","count":0},{"id":207,"name":"64982393809","count":0},{"id":208,"name":"723752707267","count":0},{"id":209,"name":"219183385641","count":0},{"id":210,"name":"198777435297","count":0},{"id":211,"name":"554334085861","count":0},{"id":212,"name":"735509176092","count":0},{"id":213,"name":"196390325791","count":0},{"id":214,"name":"856500063123","count":0},{"id":215,"name":"792777951145","count":0},{"id":216,"name":"513142206509","count":0},{"id":217,"name":"552764628311","count":0},{"id":219,"name":"24559991390965","count":0}]}'
cc=c.decode()
print(cc)